package com.fjec.devops.controller;

import com.fjec.common.protocol.JsonResult;
import com.fjec.devops.service.impl.StatAllUserNumServiceImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fjec.devops.service.IStatAllUserNumService;

import javax.annotation.Resource;

/**
 * <p>
 * 014.统计-用户数量表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-09-18
 */
@RestController
@RequestMapping("/")
public class StatAllUserNumController {

    @Resource
    private IStatAllUserNumService service;

    /**
     * 统计-用户数量
     *
     * @return
     * @throws Exception
     */
    @GetMapping("/y/stat/all/user/num")
    public JsonResult statAllUserNum() throws Exception {
        return service.statAllUserNum(15);
    }

    @GetMapping("/y/usernum/info")
    public JsonResult userNumInfo(String token, long id) throws Exception {
        return service.statUserNumInfo(id);
    }

    @GetMapping("/y/usernum/add")
    public JsonResult userNumAdd(String token, int userNum) throws Exception {
        return service.statUserNumAdd(userNum);
    }

    @GetMapping("/y/usernum/modify")
    public JsonResult userNumModify(String token, long id, int userNum) throws Exception {
        return service.statUserNumModify(id, userNum);
    }

    @GetMapping("/y/usernum/del")
    public JsonResult userNumDelete(String token, long id) throws Exception {
        return service.statUserNumDel(id);
    }

    @GetMapping("/y/usernum/fake/data")
    public JsonResult userNumFakeData() throws Exception {
        return service.statUserNumFakeData();
    }
}
